#!/bin/bash

if [ $# -ne 1 ]; then
    echo "Usage: $0 <test|pro>"
    exit 1
fi

entrypoint=""
if [ "$1" = "test" ]; then
    sed -i "s/online/sandbox/" docker-compose.yml
    sed -i "s/nginx_pro.conf/nginx_test.conf/" docker-compose.yml
    
elif [ "$1" = "pro" ]; then
    sed -i "s/sandbox/online/" docker-compose.yml
    sed -i "s/nginx_test.conf/nginx_pro.conf/" docker-compose.yml
else
    echo "Invalid parameter. Must be 'test' or 'pro'"
    exit 1
fi
sudo docker compose up -d
